package com.apps.member.account.service;

import com.apps.member.account.enums.AccountFrozenItemMinType;
import com.apps.member.account.enums.AccountFrozenItemType;
import com.apps.member.account.enums.AccountItemMinType;
import com.apps.member.account.model.po.KupaAccount;
import com.apps.member.account.model.po.KupaAccountFrozenItem;
import com.apps.sannotation.keys.JoinKey;
import com.apps.sworld.dao.sMember;

import java.math.BigDecimal;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 大鹏
 * @since 2020-10-02
 */
public interface IKupaAccountService extends sMember<KupaAccount>
{
    /**
     * 收入钱
     * @param member_id
     * @param price
     */
    KupaAccount Income(Integer member_id, BigDecimal price, AccountItemMinType itemMinType);

    /**
     * 支出钱
     * @param member_id
     * @param price
     */
    KupaAccount Spend(Integer member_id, BigDecimal price, AccountItemMinType itemMinType);

    /**
     * 冻结
     * @param member_id
     * @param price
     * @param frozenItemMinType
     * @return
     */
    KupaAccountFrozenItem Frozen(Integer member_id, BigDecimal price, AccountFrozenItemMinType frozenItemMinType);

    /**
     * 解冻一笔资金
     * @param member_id
     * @param frozen_id
     * @return
     */
    KupaAccount UnFrozen(Integer member_id, Integer frozen_id, AccountFrozenItemMinType frozenItemMinType);

    /** 暂时不实现
     * 提现
     * @param member_id
     * @param price
     * @return
     */
    default KupaAccount WithDrawal(Integer member_id,BigDecimal price){return null;};

    /**
     * 更新账户余额
     * @param member_id
     * @param price
     * @param type 1=更新账户余额数据,0=更新冻结数据
     * @return
     */
    KupaAccount updateAccount(Integer member_id, BigDecimal price,int type);
}
